﻿// ParseLib - An open source library for natural language processing.
// Copyright (C) Kais Dukes, 2012. E-mail: kais@kaisdukes.com
// http://parselib.org

using System.Collections.Generic;

namespace ParseLib.Tagging.Brill
{
    public class Lexicon
    {
        private readonly Dictionary<string, PartOfSpeech[]> _lexicon = new Dictionary<string, PartOfSpeech[]>();

        public PartOfSpeech[] DefaultTagList { get; set; }

        public PartOfSpeech[] this[string text]
        {
            get
            {
                PartOfSpeech[] tags;
                return _lexicon.TryGetValue(text, out tags) ? tags : null;
            }
        }

        public void Add(string text, PartOfSpeech[] tags)
        {
            _lexicon.Add(text, tags);
        }
    }
}